package com.jiandaoshou;

import android.content.Intent;
import android.os.Handler;

import com.jiandaoshou.base.BaseActivity;
import com.jiandaoshou.utils.ScreenUtil;
import com.jiandaoshou.utils.UserUtils;

import cn.jpush.android.api.JPushInterface;
import cn.smssdk.SMSSDK;

/**
 * Created by Administrator on 2016/10/17.
 */

public class WelcomeActivity extends BaseActivity {
    @Override
    public boolean showBackLogo() {
        return false;
    }

    @Override
    protected int getContentViewRes() {
        return R.layout.layout_welcome;
    }

    @Override
    protected String getTitleText() {
        return null;
    }

    @Override
    public void init() {
        //启动sdk
        SMSSDK.initSDK(this, "18cdf18b1839a", "1acf79f45b97ecd92be6a32f8ded4332");
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                String extra= getIntent().getStringExtra(JPushInterface.EXTRA_EXTRA);
                if (extra != null) {

                }
                ScreenUtil.getInstant().init(WelcomeActivity.this);
                Intent intent = new Intent();
                if(UserUtils.checkIsLogin(context)){
                    intent.setClass(context, MainActivity.class);
                }else{
                    intent.setClass(context, LoginActivity.class);
                }
                startActivity(intent);
                finish();
            }
        }, 1000);
    }

    @Override
    public boolean isShowTitle() {
        return false;
    }
}
